<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>居中--不用弹性布局</title>
    <style>
        .big{
            width: 800px;
            height: 500px;
            border: 3px solid black;
            margin: 0 auto;
            position: relative;
        }
        .small{
            width: 200px;
            height: 200px;
            border: 3px solid red;
            /*margin: 0 auto;*/
            position: absolute;
            left: 50%;
            top:50%;
            transform: translateX(-50%) translateY(-50%);
        }
    </style>
</head>
<body>
    <div class="big">
        <div class="small"></div>
    </div>
</body>
</html>